<template>
    <div class="phone-call">
        <img class="icon" src="@/static/images/common/phone.png" />
        <p class="number" @click="call">如有疑问请点击联系客服</p>
    </div>
</template>

<script>
export default {
    name: 'PhoneCall',
    props: {
        phoneNumber: {
            type: String,
            default: () => {
                return '';
            },
        },
    },
    methods: {
        call() {
            uni.showModal({
                title: '提示',
                content: '是否呼叫该号码？',
                success: res => {
                    if (res.confirm) {
                        uni.makePhoneCall({
                            phoneNumber: this.phoneNumber,
                        });
                    }
                },
            });
        },
    },
};
</script>

<style lang="scss" scoped>
.phone-call {
    padding: 20rpx 30rpx;
    @include flexBox(flex-start, center);
    .icon {
        width: 32rpx;
        height: 32rpx;
        margin-right: 4rpx;
    }
    .number {
        font-size: 24rpx;
        color: #898989;
        text-decoration: underline;
    }
}
</style>
